<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
<link rel="stylesheet" href="resources/css/weui.min.css">
<link rel="stylesheet" href="resources/css/jquery-weui.css">
<link rel="stylesheet" href="resources/css/style.css">
</head>
<body ontouchstart style="background:#323542;">
<!--主体-->
<div class="login-box">
  	<div class="lg-title">欢迎登录ssmShop</div>
    <div class="login-form">
    	<form action="#">
        	<div class="login-user-name common-div">
            	<span class="eamil-icon common-icon">
                	<img src="resources/icon/eamil.png" />
                </span>
                <input name="userName" placeholder="请输入您的用户名或邮箱" />        
            </div>
            <div class="login-user-pasw common-div">
            	<span class="pasw-icon common-icon">
                	<img src="resources/icon/password.png" />
                </span>
                <input type="password" name="passWord" placeholder="请输入您的密码" />        
            </div>
            <a href="javascript:submit();" class="login-btn common-div">登录</a>
        </form>
    </div>
    <div class="forgets">
    	<a href="userRetrievePassword">忘记密码？</a>
        <a href="userAdd">免费注册</a>
    </div>
</div>
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/fastclick.js"></script> 
<script src="resources/js/jquery-weui.min.js"></script>
<script src="resources/js/jquery.Spinner.js"></script>  
<script>
// 提交数据
function submit(){
	let userName = $("input[name='userName']").val();
	let passWord = $("input[name='passWord']").val();
	if(userName == ''){$.alert("请输入您的用户名或邮箱");}
	else if(passWord == ''){$.alert("请输入您的密码");}
	else{
		$.post('userLoginData',{userName,passWord},(result)=>{
        	if(result.errorCode==0){location.href="./";}
        	else{$.toast(result.errorMsg, "cancel");}
        }).error(()=>{$.toast("登录失败", "cancel");});
	}
}
// fastclick
$(function() {
    FastClick.attach(document.body);
});
</script>

</body>
</html>
